package com.project.service.impl.backend.basic;

import java.util.Date;
import java.util.List;
import com.project.dao.ArticleDao;
import com.project.dao.bean.Article;
import com.project.service.backend.basic.IPaperService;

/**
 * 课程发布 Service Impl
 * @author Sn
 *
 */
public class PaperServiceImpl implements IPaperService 
{
	
	private ArticleDao articleDao;

	@Override
	public void save(Article article) throws Exception 
	{
		article.setCrt_date(new Date());
		articleDao.save(article);
	}

	public ArticleDao getArticleDao() {
		return articleDao;
	}

	@Override
	public void update(Article article) throws Exception {
		article.setUpd_date(new Date());
		articleDao.update(article);
	}

	@Override
	public void delete(Article article) throws Exception {
		articleDao.delete(article);
	}

	@Override
	public List<Article> findPaper() throws Exception {
		return articleDao.getArticle();
	}

	@Override
	public List<Article> findPaperBypg(Article article) throws Exception {
		return articleDao.getArticle(article);
	}

	@Override
	public Article getArticleById(Article article) throws Exception {
		return articleDao.getArticleById(article);
	}

	@Override
	public void saveExl(Article article) throws Exception {
		article.setCrt_date(new Date());
		articleDao.saveExl(article);
	}
	
	public void setArticleDao(ArticleDao articleDao) {
		this.articleDao = articleDao;
	}
}
